#include <stdlib.h>

#include "tab_regions_accessibles.h"
#include "etat_partie.h"
#include "base_donnees.h"




void init_tab_regions_accessibles(struct tab_regions_accessibles* tab,
                                         const struct etat_partie* partie,
                                         const struct base_donnees* donnees)
{
    unsigned int id_region;
    int i;

    tab->nb_elements = 0;
    for(i = 0;  i < donnees->tab_regions.nb_elements;  i++)
    {
        id_region = donnees->tab_regions.tab[i].id;
        if(voir_si_region_accessible(partie, id_region, donnees))
        {
            tab->tab[tab->nb_elements] = id_region;
            tab->nb_elements++;
        }
    }
}

